﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace yue.Apl.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class imgController : ControllerBase
    {
        [HttpPost]
        public IActionResult tu(IFormFile file)
        {
            var tp=Directory.GetCurrentDirectory()+@"/wwwroot/pic/"+file.FileName;
            using (FileStream fs=new FileStream(tp,FileMode.Create))
            {
                file.CopyTo(fs);
                fs.Flush();
            }
            return Ok("https://localhost:7018/pic/" + file.FileName);
        }
    }
}
